<nz-card>
  <div class="filter-box">
    <button nz-button (click)="st.reload()"><i nz-icon nzType="reload" theme="outline"></i>刷新</button>
    <button nz-button (click)="create()" acl="Root.Db.Db.DBConfig.Create"><i nz-icon nzType="plus-circle"
        theme="outline"></i>新增</button>

    <itcore-ad-search [request]="request" [columns]="columns" (submited)="search($event)"></itcore-ad-search>
  </div>
  <st #st [data]="readUrl" [columns]="columns" [req]="req" [res]="res" [(pi)]="request.PageCondition.PageIndex"
    [(ps)]="request.PageCondition.PageSize" [page]="page" size="small" multiSort (change)="change($event)"
    (error)="error($event)" [expand]="expand">
    <ng-template #expand let-item let-index="index" let-column="column">
      <div class="db-expand-boxies">
        <div class="db-expand-box">
          <span>源数据库连接Id： {{ item.FromDbConnectionId }}</span>
          <span>目标数据库连接Id： {{ item.ToDbConnectionId }}</span>
          <span>配置Id： {{ item.Id }}</span>
        </div>
        <div class="db-expand-box">
          <span>源数据库名称： {{ item.TableNameEx[0] }}</span>
          <span>源表名： {{ item.TableNameEx[1] }}</span>
          <span>目标数据库名称： {{ item.ToDataBaseName }}</span>
        </div>

        <div class="db-expand-box" *ngIf="item.ConfigType == 2">查询sql： {{ item.SearchSql }}</div>
        <div class="db-expand-box" *ngIf="item.ConfigType == 1">
          配置：
          <span>时间字段：{{ item.TimeConditionEx.column }}</span>
          <span>天：{{ item.TimeConditionEx.value }}</span>
        </div>
        <div class="db-expand-box">备注： {{ item.Remark }}</div>
      </div>
    </ng-template>
  </st>
</nz-card>
<!--新增、编辑-->
<!-- <nz-modal #modal [nzVisible]="false" [nzTitle]="editTitle" [nzClosable]="false" [nzFooter]="null" nzWidth="600">
  <sf #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="editRow" button="none">
    <div class="modal-footer">
      <button nz-button type="button" (click)="close()">关闭</button>
      <button nz-button type="submit" [nzType]="'primary'" (click)="save(sf.value)" [disabled]="!sf.valid" [nzLoading]="http.loading">
        保存
      </button>
    </div>
  </sf>
</nz-modal> -->

<nz-drawer #drawer [nzVisible]="false" [nzTitle]="editTitle" [nzClosable]="false" nzWidth="60%">
  <sf #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="editRow" button="none">
    <div class="modal-footer">
      <button nz-button type="button" (click)="close()">关闭</button>
      <button nz-button type="submit" [nzType]="'primary'" (click)="save(sf.value)" [disabled]="!sf.valid"
        [nzLoading]="http.loading">
        保存
      </button>
    </div>
  </sf>
</nz-drawer>